﻿<?php
require_once("admin-header.php");
?>
<meta http-equiv="Content-Type" content="text/html; charset=utf8">
<html>
<title>导入ID到比赛</title>
<font size="+2" face="微软雅黑">导入ID到比赛</font>
Designer : <a href='http://hi.baidu.com/%E9%83%AD%E5%A4%A7%E4%BE%A0%E7%88%B1%E5%86%99%E4%BB%A3%E7%A0%81/home'>CSGrandeur</a></br>
<li><a href="index.php">返回管理页</a></li>
</html>
<br />
<?php
mysql_query('create table if not exists cr
( 
uid VARCHAR(20) primary   key,
a__ VARCHAR(5),
b__ VARCHAR(5),
c__ VARCHAR(5),
d__ VARCHAR(5),
e__ VARCHAR(5),
f__ VARCHAR(5),
g__ VARCHAR(5),
h__ VARCHAR(5),
i__ VARCHAR(5),
j__ VARCHAR(5),
k__ VARCHAR(5),
l__ VARCHAR(5),
m__ VARCHAR(5),
n__ VARCHAR(5),
o__ VARCHAR(5),
p__ VARCHAR(5),
q__ VARCHAR(5),
r__ VARCHAR(5),
s__ VARCHAR(5)
)') or die('创建表失败！');
$result = mysql_query("SELECT * FROM users");
while($row = mysql_fetch_array($result))
  {
  	$values='\''.$row['user_id'].'\'';
  echo $values;
  for($i = 0; $i < 19; $i ++)
  	$values.=',\'0\'';
  	$values.'\'';
  if ( !mysql_query('insert into cr values('.$values.')') )
                echo '建立表项失败！</br>';
            else
                echo '成功!</br>';
   }
   echo "已成功建立气球标记表";
mysql_close();
?>